package com.sixteen.ordering_system.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sixteen.ordering_system.pojo.Dish;
import com.sixteen.ordering_system.pojo.DishCart;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;


@Mapper
@Repository
public interface DishCartMapper extends BaseMapper<DishCart> {
//    @Insert("insert into dish_cart(dish_id,sys_user_id,remark) values(#{dish_id},#{sys_user_id},#{remark}) ");
//    DishCart insertCart(@Param("dish_id") Integer dishId,
//                        @Param("number") Integer number,
//                        @Param("sys_user_id") Integer sysUserId);

    //    插入购物车数据
    Integer insertCart(DishCart dishCart);
    Integer seleNum(Integer number,Integer dishCartId);
//    修改购物车中菜品的数量
    Integer updateNum(Integer number,Integer dishCartId);

    List<DishCart> cartAll(Integer sysUserId);

    Integer delNum(DishCart dishCart);

    List<DishCart> selCategory();

}
